package xin.nick.service.impl;

import org.apache.dubbo.config.annotation.Service;
import xin.nick.service.MyService;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @author Nick
 * @date 2021/7/17
 * @description
 */
@Service
public class MyServiceImpl implements MyService {
    @Override
    public String method1() {
        try {
            Thread.sleep(ThreadLocalRandom.current().nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        } finally {
            return "method1";
        }
    }

    @Override
    public String method2() {
        try {
            Thread.sleep(ThreadLocalRandom.current().nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        } finally {
            return "method2";
        }
    }

    @Override
    public String method3() {
        try {
            Thread.sleep(ThreadLocalRandom.current().nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        } finally {
            return "method3";
        }
    }
}
